import { findHeadCategory } from '@/api/home'
// category状态
export default {
  namespaced: true,
  state: () => ({
    categoryList: []
  }),
  mutations: {
    setCategoryList (state, payload) {
      state.categoryList = payload
    }
  },
  actions: {
    async asyncSetList (ctx) {
      const res = await findHeadCategory()
      ctx.commit('setCategoryList', res.result)
    }
  }
}
